<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = {
            1: 'abc',
            2: 'bbb',
            i: 'ccc'
        };
        console.log(obj['i']);
        //对象名是数字，获取对象值只能用obj[数字]或者obj['数字'],不能写成obj.数字
        //对象名是英文，获取对象值可以是obj.英文或者obj['英文']不能写成obj[英文](会当成变量来解析)
    </script>
</body>

</html>